import { common } from '@/common/api/common.js'
const apis = {
    getSessionKey,
    getPhone,
    register,
    getUserInfo,
    wxpay,
    getChildren,
    addChildren,
    currentChildren,
    switchCurrentChildren,
    getSchool,
    getCategoryTree,
    getListPageByClass,
    getClassScheduleById,
    getOrderList,
    orderDetails,
    submitPayOrder,
    launchPay,
    studentClassPage,
    studentCurrent,
    listClassSuccessChild,
    applyForClass,
    applyForClassRefund,
    setIconNickname,
    teacherLogin,
    teacherClassPage,
    check,
    getTeacherInfo,
    getschool,
    judgeClock,
    currentClock,
    addleave,
    getLeaveList,
    addtakeClass,
    getTakeClassList,
    getUserList,
    tearcherStatistics,
    getBeforeWorkList,
    addbeforeWork,
    addafterWork,
    getAfterWorkList,
    delleave,
    deltakeClass,
    getListClassSuccessChild,
    getschooltime,
    getschoolInfo,
    addCart,
    getShopCartList,
    deleteShopCart,
    childrenLeaveHistory,
    applyLeave,
    cancelLeave,
    currentSchedule,
}
// 获取sessionKey
function getschoolInfo(data, CallBack) {
    common.urlRequest('admin/school/get', data, 'post', CallBack)
}
// 获取sessionKey
function getSessionKey(data, CallBack) {
    common.urlRequest('api/biz/member/getWxMaJscode2Sessionf', data, 'post', CallBack)
}

// 判断能否打卡
function judgeClock(data, CallBack) {
    common.urlRequest('admin/clockin/judgeClock', data, 'post', CallBack)
}
// 判断能否打卡
function currentClock(data, CallBack) {
    common.urlRequest('admin/clockin/currentClock', data, 'post', CallBack)
}

// 获取教师信息
function getschool(data, CallBack) {
    common.urlRequest('admin/school/list', data, 'post', CallBack)
}
// 获取教师信息
function getTeacherInfo(data, CallBack) {
    common.urlRequest('admin/user/info', data, 'post', CallBack)
}
// 打卡
function check(data, CallBack) {
    common.urlRequest('admin/clockin/save', data, 'post', CallBack)
}
// 教师排课
function teacherClassPage(data, CallBack) {
    common.urlRequest('admin/classSchedule/teacherClassPage', data, 'post', CallBack)
}
// 教师登录
function teacherLogin(data, CallBack) {
    common.urlRequest('admin/user/teacherLogin', data, 'post', CallBack)
}
// 获取手机号
function getPhone(data, CallBack) {
    common.urlRequest('api/biz/member/decryptWxPhone', data, 'post', CallBack)
}
// 微信小程序注册登录
function register(data, CallBack) {
    common.urlRequest('api/biz/member/wxLoginByPhone', data, 'post', CallBack)
}
// 获取用户信息
function getUserInfo(data, CallBack) {
    common.urlRequest('api/biz/member/info', data, 'post', CallBack)
}
// 设置用户头像
function setIconNickname(data, CallBack) {
    common.urlRequest('api/biz/member/setIconNickname', data, 'post', CallBack)
}

// 获取孩子列表
function getChildren(data, CallBack) {
    common.urlRequest('api/biz/childrens/listChild', data, 'post', CallBack)
}
// 添加孩子
function addChildren(data, CallBack) {
    common.urlRequest('api/biz/childrens/save', data, 'post', CallBack)
}
//获取当前使用孩子
function currentChildren(data, CallBack) {
    common.urlRequest('api/biz/childrens/defChild', data, 'post', CallBack)
}

// 切换默认孩子
function switchCurrentChildren(data, CallBack) {
    common.urlRequest('api/biz/childrens/changeDefAddr', data, 'post', CallBack)
}

// 获取课程表
function studentClassPage(data, CallBack) {
    common.urlRequest('api/biz/classSchedule/studentClassPage', data, 'post', CallBack)
}
// 根据请假日期返回当天的课程
function studentCurrent(data, CallBack) {
    common.urlRequest('api/biz/classSchedule/studentCurrent', data, 'post', CallBack)
}
// 获取学校列表
function getSchool(data, CallBack) {
    common.urlRequest('api/biz/school/list', data, 'post', CallBack)
}


// 获取课程分类树状图
function getCategoryTree(data, CallBack) {
    common.urlRequest('api/biz/category/tree', data, 'post', CallBack)
}

// 获取当前孩子所在年级的课程
function getListPageByClass(data, CallBack) {
    common.urlRequest('api/biz/classSchedule/listPageByClass', data, 'post', CallBack)
}

// 根据Id获取课程详情
function getClassScheduleById(data, CallBack) {
    common.urlRequest('api/biz/classSchedule/getById', data, 'post', CallBack)
}

// 根据订单列表
function getOrderList(data, CallBack) {
    common.urlRequest('api/biz/order/orderSearchPage', data, 'post', CallBack)
}

// 提交订单支付
function submitPayOrder(data, CallBack) {
    common.urlRequest('api/biz/orderSubscribe/submitPay', data, 'post', CallBack, true)
}

// 待支付订单支付
function launchPay(data, CallBack) {
    common.urlRequest('api/biz/orderSubscribe/launchPay', data, 'post', CallBack)
}

// 订单详情
function orderDetails(data, CallBack) {
    common.urlRequest('api/biz/order/get', data, 'post', CallBack)
}

// 申请调课
function applyForClass(data, CallBack) {
    common.urlRequest('api/biz/orderSubscribe/applyForClass', data, 'post', CallBack)
}

// 申请退课
function applyForClassRefund(data, CallBack) {
    common.urlRequest('api/biz/orderSubscribe/applyForClassRefundNew', data, 'post', CallBack)
}
// 请假申请
function addleave(data, CallBack) {
    common.urlRequest('admin/leave/save', data, 'post', CallBack)

}
// 请假列表
function getLeaveList(data, CallBack) {
    common.urlRequest('admin/leave/tearcherPage', data, 'post', CallBack)

}
// 代课申请
function addtakeClass(data, CallBack) {
    common.urlRequest('admin/takeClass/save', data, 'post', CallBack)

}
// 代课列表
function getTakeClassList(data, CallBack) {
    common.urlRequest('admin/takeClass/tearcherPage', data, 'post', CallBack)

}
// 代课老师列表
function getUserList(data, CallBack) {
    common.urlRequest('admin/user/listPage', data, 'post', CallBack)

}
// 月度统计列表
function tearcherStatistics(data, CallBack) {
    common.urlRequest('admin/tearcherStatistics/listPage', data, 'post', CallBack)

}
// 校内记录列表
function getBeforeWorkList(data, CallBack) {
    common.urlRequest('admin/beforeWork/tearcherPage', data, 'post', CallBack)

}
// 课后反馈列表
function getAfterWorkList(data, CallBack) {
    common.urlRequest('admin/afterWork/tearcherPage', data, 'post', CallBack)

}

// 添加校内记录
function addbeforeWork(data, CallBack) {
    common.urlRequest('admin/beforeWork/save', data, 'post', CallBack)

}
// 添加课后反馈
function addafterWork(data, CallBack) {
    common.urlRequest('admin/afterWork/save', data, 'post', CallBack)

}
// 撤销请假申请
function delleave(data, CallBack) {
    common.urlRequest('admin/leave/cancel', data, 'post', CallBack)

}
//撤销代课申请
function deltakeClass(data, CallBack) {
    common.urlRequest('admin/takeClass/cancel', data, 'post', CallBack)

}
//当前课程学生
function getListClassSuccessChild(data, CallBack) {
    common.urlRequest('admin/childrens/listClassSuccessChild', data, 'post', CallBack)

}
//返回老师当日上课时间
function getschooltime(data, CallBack) {
    common.urlRequest('admin/classSchedule/schooltime', data, 'post', CallBack)

}

// 订单详情
// function orderDetails(data, CallBack) {
//     common.urlRequest('api/biz/order/get', data, 'post', CallBack)
// }

// 获取该课程已报名学生
function listClassSuccessChild(data, CallBack) {
    common.urlRequest('api/biz/childrens/listClassSuccessChild', data, 'post', CallBack)
}

// 申请调课 
// function applyForClass(data, CallBack) {
//     common.urlRequest('api/biz/orderSubscribe/applyForClass', data, 'post', CallBack)
// }

// 申请退课
// function applyForClassRefund(data, CallBack) {
//     common.urlRequest('api/biz/orderSubscribe/applyForClassRefund', data, 'post', CallBack)
// }

//微信支付
function wxpay(data, CallBack) {
    common.urlRequest('api/makeOrder', data, 'post', CallBack)
}

// 加入购物车
function addCart(data, CallBack) {
    common.urlRequest('api/biz/cartItem/addCart', data, 'post', CallBack)
}
// 购物车列表
function getShopCartList(data, CallBack) {
    common.urlRequest('api/biz/cartItem/cartsByMemberId', data, 'post', CallBack)
}

// 删除购物车课程
function deleteShopCart(data, CallBack) {
    common.urlRequest('api/biz/cartItem/deleteCartIds', data, 'post', CallBack)
}

// 学生请假记录
function childrenLeaveHistory(data, CallBack) {
    common.urlRequest('api/biz/studentLeave/listPage', data, 'post', CallBack)
}

// 申请请假
function applyLeave(data, CallBack) {
    common.urlRequest('api/biz/studentLeave/save', data, 'post', CallBack)
}

// 取消请假
function cancelLeave(data, CallBack) {
    common.urlRequest('api/biz/studentLeave/cancel', data, 'post', CallBack)
}
// 根据课程id返回今天请假的学生列表
function currentSchedule(data, CallBack) {
    common.urlRequest('admin/studentLeave/currentSchedule', data, 'post', CallBack)
}

export {
    apis
}